﻿module Sustainalytics.Routing {

    export class RoutingEngineAdapter implements IRoutingEngineAdapter {

        constructor(
            private $route: ng.route.IRouteService,
            private $routeParams: ng.route.IRouteParamsService) {
        }

        public getCurrentPath(): string {
            var ctx = this;

            if (!ctx.$route.current || !ctx.$route.current['$$route'])
                return '/';

            // get current path
            var path = ctx.$route.current['$$route'].originalPath;

            return path;
        }

        public getRouteParams(): any {
            var ctx = this;

            return ctx.$routeParams;
        }
    }
} 